package com.df.bpm.utils.businessViewerV2.human;

import com.df.bpm.utils.businessViewerV2.Main;
import com.df.common.utils.CommonUtils;

import javax.swing.*;
import java.util.List;

public class C_human {

    static Db_human database=new Db_human();

    public static List<M_human> search(List<JTextField> fields) {
        M_human temp=new M_human();
        if (CommonUtils.varIsNotBlank(fields.get(0).getText())) {
            temp.setNumber(fields.get(0).getText());
        }
        if (CommonUtils.varIsNotBlank(fields.get(1).getText())) {
            temp.setName(fields.get(1).getText());
        }
        temp.setDepartment("信息部");//开发者肯定是信息部的
        return database.getList4Like(temp);
    }

    public static M_human selectOne() throws Exception {
        V_human vHuman=new V_human();
        vHuman.repaint();
        vHuman.search();
        vHuman.setVisible(true);

        return vHuman.selectResult;
    }

    public static void main(String[] args) throws Exception {
        Main.getScreenMaxSize();
        String strType=selectOne().toString();
        System.out.println(strType);
    }
}
